package net.wwang.blog.dao;

import net.wwang.blog.pojo.Role;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface RoleDao extends JpaRepository<Role,String>, JpaSpecificationExecutor<Role> {
    @Query(nativeQuery=true,value = "select `role_name` from `role` where `id` in (:ids)")
    List<String> findRolesByUserIds(@Param("ids") List<String> ids);
}
